package com.webchat.rmi.search;

import com.webchat.common.bean.APIResponseBean;
import com.webchat.domain.vo.request.search.MilvusSearchRequestVO;
import com.webchat.rmi.interceptor.RpcRequestInterceptor;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;


@FeignClient(name = "webchat-search-service",
        contextId = "vectorSearchEngineClient",
        configuration = RpcRequestInterceptor.class)
public interface VectorSearchEngineClient {


    /**
     * 基于场景创建向量集合
     *
     * @return
     */
    @PostMapping("/search-service/vector/connection/create/{biz}")
    APIResponseBean<Boolean> createCollection(@PathVariable String biz);

    /**
     * 删除指定场景的向量集合
     *
     * @return
     */
    @PostMapping("/search-service/vector/connection/drop/{biz}")
    APIResponseBean<Boolean> dropCollection(@PathVariable String biz);

    /**
     * 基于向量相似度数据搜索
     *
     * @param biz
     * @param milvusSearchReq
     * @return
     */
    @PostMapping("/search-service/vector/search/{biz}")
    APIResponseBean<Object> search(@PathVariable String biz,
                                   @RequestBody MilvusSearchRequestVO milvusSearchReq);

}
